﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using WMS.Model;
using WMS.SQLServerDAL;

namespace WMS.BLL
{
   public class WhsMngrManage
   {
       StockMngrData dal = new StockMngrData();
       #region 仓库维护方法
       public DataTable GetAllWhsInfo(WhsModel model)
       {
           return dal.GetStockInfo(model);
       }

       public int DelWhsByIds(string ids)
       {
           int rows = dal.DelStockByIds(ids);      
           return rows;
       }

       public int AddWhs(WhsModel model)
       {
           int rows = dal.AddStock(model);  
           return rows;
       }

       public int MidifyWhs(WhsModel model)
       {
           int rows = dal.ModifyStock(model);
           return rows;
       }
       #endregion

       #region 仓库权限设定
       //public DataTable GetWhsLst(string supId)
       //{
       //    // string supId = 
       //    return null;
       //}


       public DataTable GetWhsRoleByRoleId(string roleId,string supId)
       {
           DataTable dt = dal.GetWhsRoleByRoleIdData(roleId, supId);
           return dt;
       }

       public DataTable GetUserRoles(string supId)
       {
           //OrderOnlineRoleGetAll
           DataTable dt = dal.RoleGetAllData(supId);
           return dt;
       }
       
       public int SetWhsPermiss(WMS.Model.OrderOnline_Role role,string whss,string uName,string supId)
       {
           int rs = 0;
           rs = dal.SetWhsPermissData(role, whss, uName, supId);
           return rs;
       }
       #endregion
   }
}
